package com.yunxi.service.dubboService.impl.sto;

import com.github.pagehelper.PageInfo;
import com.yunxi.model.sto.PartnerVehicleTradeDetail;
import com.yunxi.service.localService.sto.PartnerVehicleTradeDetailService;
import com.yunxi.sto.pojo.PartnerVehicleTradeDetailVO;
import com.yunxi.sto.service.PartnerVehicleTradeDetailDubboService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import java.util.List;

/**
 * <p>
 * 渠道商车辆买卖详情 服务实现类
 * </p>
 *
 * @author caoYong
 * @since 2019-08-30
 */
public class PartnerVehicleTradeDetailDubboServiceImpl implements PartnerVehicleTradeDetailDubboService {

    @Autowired
    @Qualifier(value = "partnerVehicleTradeDetailServiceImpl")
    PartnerVehicleTradeDetailService partnerVehicleTradeDetailService;


    @Override
    public PartnerVehicleTradeDetailVO getById(String id) throws Exception {
        PartnerVehicleTradeDetail partnerVehicleTradeDetail = partnerVehicleTradeDetailService.getById(id);
        PartnerVehicleTradeDetailVO partnerVehicleTradeDetailVO = new PartnerVehicleTradeDetailVO();
        BeanUtils.copyProperties(partnerVehicleTradeDetail, partnerVehicleTradeDetailVO);
        return partnerVehicleTradeDetailVO;
    }

    @Override
    public void saveOrUpdate(PartnerVehicleTradeDetailVO partnerVehicleTradeDetailVO) throws Exception {
        PartnerVehicleTradeDetail partnerVehicleTradeDetail = new PartnerVehicleTradeDetail();
        BeanUtils.copyProperties(partnerVehicleTradeDetailVO, partnerVehicleTradeDetail);
        partnerVehicleTradeDetailService.saveOrUpdate(partnerVehicleTradeDetail);
    }

    @Override
    public void removeById(String id) {
        partnerVehicleTradeDetailService.removeById(id);
    }

    @Override
    public PageInfo<PartnerVehicleTradeDetailVO> findPageByVO(PartnerVehicleTradeDetailVO partnerVehicleTradeDetailVO, Integer pageNum, Integer pageSize) throws Exception {
        PageInfo<PartnerVehicleTradeDetailVO> pageInfo = partnerVehicleTradeDetailService.pageByVo(partnerVehicleTradeDetailVO, pageNum, pageSize);
        return pageInfo;
    }

    @Override
    public void removeByListVo(List<PartnerVehicleTradeDetailVO> partnerVehicleTradeDetailVOList) throws Exception {
        partnerVehicleTradeDetailService.removeByListVo(partnerVehicleTradeDetailVOList);
    }

    @Override
    public List listByVo(PartnerVehicleTradeDetailVO partnerVehicleTradeDetailVO) {
        return partnerVehicleTradeDetailService.listByVo(partnerVehicleTradeDetailVO);
    }
}
